use tauri::{AppHandle, Emitter, EventTarget};

#[allow(dead_code)]
#[tauri::command]
fn open_file(app: AppHandle, path: std::path::PathBuf) {
    println!("Opening file: {:?}", path);
    app.emit_filter("open-file", path, |target| match target {
        EventTarget::WebviewWindow { label } => label == "main" || label == "file-viewer",
        _ => false,
    })
    .unwrap();
}
